#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H

#include <QWidget>

namespace Ui {
class MusicSlider;
}

class MusicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit MusicSlider(QWidget *parent = nullptr);
    ~MusicSlider();

    void setStep(float ratio);

//    bool eventFilter(QObject *watched, QEvent *event);
signals:
    void setMusicSliderPosition(float ratio);

protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void moveSlider();

    void enterEvent(QEvent *event);
    void leaveEvent(QEvent *event);
private:
    Ui::MusicSlider *ui;

    int currentPos;  // 播放进度
};

#endif // MUSICSLIDER_H
